A UAV commonly has a detecting module such as a camera configured for detecting and avoiding obstacles during flight. However, if the UAV collides with the obstacles, the detecting module mounted on the UAV may be shifted or even damaged due to the collision, which may negatively impact the UAV's obstacle avoidance capability.